From: Florian Müllner Date: Mon, 12 May 2025 23:18:28 +0000 (+0200) Subject: tools/toolbox: Support --devkit when running shell X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~124^2^2~79 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=a44546ddb7893200a66df3432276005806d94d7c;p=gnome-shell.git tools/toolbox: Support --devkit when running shell It is the modern replacement for nested mode, and does not depend on the X11 backend that is on its way out. For now keep support for --nested as a fallback, so the script keeps working on older branches. Part-of: --- diff --git a/tools/toolbox/run-gnome-shell.sh b/tools/toolbox/run-gnome-shell.sh index 349898c77..23b1186b5 100755 --- a/tools/toolbox/run-gnome-shell.sh +++ b/tools/toolbox/run-gnome-shell.sh @@ -49,6 +49,14 @@ should_run_nested() { [[ "$XDG_SESSION_TYPE" != "tty" ]] && [[ ! "$HEADLESS" ]] } +has_devkit() { + toolbox --container $TOOLBOX run gnome-shell --help | grep -q -- --devkit +} + +has_nested() { + toolbox --container $TOOLBOX run gnome-shell --help | grep -q -- --nested +} + # load defaults . $CONFIG_FILE TOOLBOX=$DEFAULT_TOOLBOX @@ -147,15 +155,25 @@ while true; do esac done +FORCE_DISPLAY=1 if should_run_nested; then - SHELL_ARGS+=( --nested ) + if has_devkit; then + SHELL_ARGS+=( --devkit ) + FORCE_DISPLAY=0 + elif has_nested; then + SHELL_ARGS+=( --nested ) + else + die Mutter has to be built with devkit or x11 support + fi else SHELL_ARGS+=( --wayland ) fi -display=toolbox-wayland-$RANDOM -SHELL_ENV+=(WAYLAND_DISPLAY=$display) -SHELL_ARGS+=(--wayland-display=$display) +if [ $FORCE_DISPLAY -gt 0 ]; then + display=toolbox-wayland-$RANDOM + SHELL_ENV+=(WAYLAND_DISPLAY=$display) + SHELL_ARGS+=(--wayland-display=$display) +fi toolbox --container $TOOLBOX run \ env "${SHELL_ENV[@]}" dbus-run-session $GDB gnome-shell "${SHELL_ARGS[@]}"